﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MDF.Cacher.Interfaces
{
    /// <summary>
    /// Info cache
    /// Mr.Duc
    /// 23/2/2014
    /// </summary>
    public class CacheObject
    {
        /// <summary>
        /// A unique key
        /// </summary>
        public string Keyword { get; set; }
        /// <summary>
        /// Data to cache
        /// </summary>
        public object Value { get; set; }
        /// <summary>
        /// Times to get this cache object
        /// </summary>
        public int Views { get; set; }
        /// <summary>
        /// Updated date cache object
        /// </summary>
        public DateTime Updatedate { get; set; }
        /// <summary>
        /// Created date cache object
        /// </summary>
        public DateTime Createdate { get; set; }
        /// <summary>
        /// The time expridate
        /// </summary>
        public DateTime Expridate { get; set; }
        /// <summary>
        /// Constructor default
        /// </summary>
        public CacheObject()
        {
            this.Createdate = DateTime.Now;
            this.Updatedate = DateTime.Now;
        }
        /// <summary>
        /// Constructor with many values
        /// </summary>
        /// <param name="_strKey"></param>
        /// <param name="_objValue"></param>
        /// <param name="_dtExpridate"></param>
        public CacheObject(string _strKey, object _objValue, DateTime _dtExpridate)
        {
            this.Keyword = _strKey;
            this.Value = _objValue;
            this.Expridate = _dtExpridate;
            this.Createdate = DateTime.Now;
            this.Updatedate = DateTime.Now;
            this.Views = 0;
        }
    }
}
